<?php 
// -----------------------------------------------------------------------------
// sdefastsearch - A PHP Fast ESP Search API
// Copyright (C) 2008,2009 sueddeutsche.de GmbH, Hultschiner Str. 8, D-81677 München
// www.sueddeutsche.de.de - Andreas.Scheerer@sueddeutsche.de
//
// This file is part of sdefastsearch.
//
// sdefastsearch is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------

/**
 * @author  Andreas Scheerer <Andreas.Scheerer@sueddeutsche.de>
 * @version $Id: navigation.tpl.php 11 2009-08-23 04:23:33Z andreas.scheerer $ 
 */
 
?>
<?php if ($templData['navIter']->count() < 1)  { ?>
<div id="emptynavigation">
    no matching navigators found.
</div>    
<?php } else { ?>
<div id="navigation">
    <?php 
    $tmpl_navIter = $templData['navIter'];
    while ($templData['navIter']->valid()) { 
        ?>
        <div class="navigator">
        <?php echo $tmpl_navIter->current()->getDisplayName(); ?>
        (<?php echo $tmpl_navIter->current()->modifierCount(); ?>)
        <?php 
        $tmpl_modIter = $navIter->current()->modifiers();
        $tmpl_modCount = 0;    
        while ($tmpl_modIter->valid() && $tmpl_modCount < $templData['numNavHits']) { ?>
            <div class="modifier">
            <?php 
            $tmpl_modStr = $tmpl_navIter->current()->getFieldName().':'.$tmpl_modIter->current()->getValue();
            if (substr_count($templData['navStr'], $tmpl_modStr) > 0) { ?>
                <?php echo $tmpl_modIter->current()->getName(); ?> 
                <a href="<?php echo $templData['baseGetURL']?>&drillup=<?php 
                echo rawurlencode('+'.$tmpl_modStr);?>">off</a>
            <?php
            } else {
            ?>
                <a href="<?php echo $templData['baseGetURL']?>&drilldown=<?php
                    echo rawurlencode('+'.$tmpl_modStr);
                ?>" class="drilldown">
                <?php echo $tmpl_modIter->current()->getName(); ?>
                </a>                
                (<?php echo $tmpl_modIter->current()->getCount(); ?>)
            <?php
            }
            ?>
            </div>
            <?php $tmpl_modIter->next(); $tmpl_modCount++;?>
        <?php
        }     
        if ($tmpl_modIter->count() > $templData['numNavHits']) {
            ?>
            <div class="more">
            (<?php echo $tmpl_modIter->count()-$templData['numNavHits']; ?> more...)
            </div>
        <?php
        } 
        ?>
        </div>
        <?php
        $templData['navIter']->next();
    } 
    ?>
</div>
<?php } ?>
